from scipy.integrate import quad
import numpy as np

# 定义第一个积分的被积函数
def integrand_a(x):
    return np.cos(np.exp(x))**2

# 计算第一个积分
result_a, error_a = quad(integrand_a, 0, 3)
print(f"The result of the first integral is: {result_a}")

# 定义第二个积分的被积函数
def integrand_b(x, y):
    return 16 * x * y / np.sqrt(1 - 4 * y**2)

# 计算第二个积分
result_b, error_b = quad(lambda y: quad(integrand_b, 0, np.sqrt(1 - 4 * y**2), args=(y,))[0], 0, 1/2)
print(f"The result of the second integral is: {result_b}")